﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Clueless
{
    public partial class accusation : Form
    {
        public event EventHandler<AccusationEventArgs> AccuseSelected;


        public accusation()
        {
            InitializeComponent();
        }

        private void accuseCancelButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            
        }

        private void accuseButton_Click(object sender, EventArgs e)
        {
            SendAccusationMessage(accuseSuspectComboBox.Text, accuseWeaponComboBox.Text, accuseRoomComboBox.Text);
        }

        /// <summary>
        /// Start Trun
        /// </summary>
        /// <param name="s"></param>
        private void SendAccusationMessage(String c, String w, String r)
        {
            this.Hide();
            Console.WriteLine("Accusation!  c:" + c + " w:" + w + " r:");
            AccusationEventArgs args = new AccusationEventArgs();
            args.character = c;
            args.weapon = w;
            args.room = r;
            OnAccusationMessage(args);
        }
        public virtual void OnAccusationMessage(AccusationEventArgs e)
        {
            EventHandler<AccusationEventArgs> handler = AccuseSelected;
            if (handler != null)
            {
                handler(this, e);
            }
        }

    }

    public class AccusationEventArgs : EventArgs
    {
        public String character { get; set; }
        public String weapon { get; set; }
        public String room { get; set; }
    }
}
